import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css' 
import router from './router/index'
import { createI18n } from 'vue-i18n'
import enUS from './locales/enUS'
import zhCN from './locales/zhCN'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'viewerjs/dist/viewer.css';
import VueViewer from 'v-viewer';
import vue3videoPlay from 'vue3-video-play'; // 引入组件
import 'vue3-video-play/dist/style.css'; // 引入css
//
// @ts-ignore
import JsonViewer from 'vue3-json-viewer'
import store, { key } from './store/index'
// @ts-ignore
import VueHighlightJS from 'vue3-highlightjs'
import { VueDraggableNext } from 'vue-draggable-next'
import 'highlight.js/styles/atom-one-dark.css'
 
const i18n = createI18n({
    locale: 'zhCN',
    legacy: false,
    messages: {
      enUS,
      zhCN
    }
  })

const app = createApp(App)
//组件
app.use(ElementPlus, { size: 'small', zIndex: 10 ,locale: zhCn  }) 
//图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.component(`draggable`, VueDraggableNext)
//--
app.use(i18n);
app.use(store);
app.use(router);
app.use(VueViewer);
app.use(vue3videoPlay);   
// 加载json美化显示
app.use(JsonViewer)
// 加载Vuex
app.use(store, key)
// 代码高亮
app.use(VueHighlightJS)

app.mount('#app')
